package my.action.authentication;
import javax.servlet.http.*;
import my.controller.*;
import my.db.DAO.AuthenticationDAO;
import my.db.DTO.AuthenticationDTO;
public class AuthenticationDeleteAction implements  Action{
	 public ActionForward execute(HttpServletRequest request,HttpServletResponse response) throws Exception{
		
		 //Fields
		 	AuthenticationDAO autDAO=new AuthenticationDAO();
			AuthenticationDTO dto=null;
		   	ActionForward forward=new ActionForward();
		   	boolean result=true;
		 
		//checking condition
	   		try{   			
	   			result=autDAO.deleteAccount(1);
	   			forward.setRedirect(false);
	   			if(result==true){   
	   				forward.setPath("./delete_account.jsp?error= Delete successfully ");
	   			}else{
	   				forward.setPath("./delete_account.jsp?error= Delete unsuccessfully ");
	   			}
	  		}catch(Exception ex){
	  			//System.out.println(ex);
	   		}
	  		return forward;
		}  	
}